#ifndef __FRAME_H
#define __FRAME_H
#include<wx/wx.h>
#include <wx/socket.h>
#include"SahovskaPloca.h"
#include"Figura.h"
#include"MenuBar.h"
#include "wx/wxhtml.h"

class Client;
class Server;

class Point:public wxPoint
{
	int x;
	int y;
public:
};
enum
{
	EVT_MENU_NEW,
	EVT_MENU_EXIT, 
	EVT_MENU_CREATE_SERVER,
	EVT_MENU_JOIN_SERVER,
	EVT_MENU_MYIP,
	EVT_MENU_HELP,
	EVT_MENU_ABOUT,
	EVT_DOWN,
	EVT_BUTT
};
class Frame:public wxFrame,Point
{
	wxPanel *panel;
	//wxStaticText *st1;
	//wxStaticText *st2;
	//wxStaticText *st3;
	//wxStaticText *st4;
	wxPoint a1;
	SahovskaPloca *sahovskaPloca;
	wxMenuBar *menu_Bar;
	wxMenu *menuFile;
	wxMenu *menuConnect;
	wxMenu *menuHelp;
	wxTextCtrl *ctext;
	
	int counter;
public:
	SahovskoPolje* polje;
	Figura figura;
	bool isServer;
	int x1,y1,x2,y2;
	Client *client;
	Server *server;
	wxTextCtrl *displayInfo;
	wxTextCtrl *chatText;
	wxButton *sendMsg;
	int presCount;
	wxBitmap g_TestBitmap;
	
	Frame(const wxString& title);
	~Frame();

	void NewMove(int x1, int y1, int x2, int y2);
	void SendData();
	void OnPaint(wxPaintEvent& event);
	void OnMove(wxMoveEvent& event);
	void OnMoveMouse(wxMouseEvent& event);
	void OnMousePress(wxMouseEvent& event);
	void OnMouseEvent(wxMouseEvent& event);
	void DrawArray(wxDC &dc);
	void SetSahovskaPloca(SahovskaPloca *p_sahovskaPloca);
	void NewGame(wxCommandEvent& WXUNUSED(event));
	void NewGame();
	void ExitGame(wxCommandEvent& WXUNUSED(event));
	void OnAbout(wxCommandEvent& WXUNUSED(event));
	void CreateServer(wxCommandEvent& WXUNUSED(event));
	void JoinServer(wxCommandEvent& WXUNUSED(event));
	void MyIPAdrress(wxCommandEvent& WXUNUSED(event));
	void OnKeyDown(wxKeyEvent& event);
	void OnButtonClick(wxCommandEvent &event);
	void UpdateStatus();
	DECLARE_EVENT_TABLE()
};

#endif